<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
    String ctx = request.getContextPath();
    request.setAttribute("ctx", ctx);
%>
<html>
<head>
    <title>POM 项目</title>
    <script src="js/jquery-1.9.1.min.js"></script>
    <script src="js/fileupload.js"></script>
    <link rel="stylesheet" href="css/img.css">
    <link rel="stylesheet" href="css.css">
</head>
<body>
<h6>登陆成功${user}</h6>
<form action="list.do" method="post">
    <input type="hidden" name="cpage">
    订单编号:<input type="text" name="dingdanbianhao" value="${map.dingdanbianhao}">
    制单人:<input type="text" name="zhidanren" value="${map.zhidanren}"><br>
    仓库:<input type="text" name="cangku" value="${map.cangku}">
    订货人:<input type="text" name="dinghuoren" value="${map.dinghuoren}"><br>
    交货方式:<input type="text" name="jiaohuofangshi" value="${map.jiaohuofangshi}">
    物流单号:<input type="text" name="wuliudanhao" value="${map.wuliudanhao}"><br>
    交货地点:<input type="text" name="jiaohuodidian" value="${map.jiaohuodidian}"><br>
    下单时间:<input type="text" name="xiadanshijianD" value="${map.xiadanshijianD}">-
    <input type="text" name="xiadanshijianX" value="${map.xiadanshijianX}"><br>
    库位:<input type="text" name="kuweiD" value="${map.kuweiD}">-
    <input type="text" name="kuweiX" value="${map.kuweiX}"><br>
    总金额:<input type="text" name="zongjineD" value="${map.zongjineD}">-
    <input type="text" name="zongjineX" value="${map.zongjineX}"><br>
    折让金额:<input type="text" name="zherangjineD" value="${map.zherangjineD}">-
    <input type="text" name="zherangjineX" value="${map.zherangjineX}"><br>
    附件成本:<input type="text" name="fujianchengbenD" value="${map.fujianchengbenD}">-
    <input type="text" name="fujianchengbenX" value="${map.fujianchengbenX}">
    <h1><a href="list2.do">下单时间升序</a></h1><br>
    <h1><a href="list3.do">总金额升序</a></h1><br>
    <input type="submit" value="查询">
</form>
<table>
    <tr>
        <td>编号</td>
        <td>下单时间</td>
        <td>订单编号</td>
        <td>制单人</td>
        <td>仓库</td>
        <td>库位</td>
        <td>订货人</td>
        <td>总金额</td>
        <td>折让金额</td>
        <td>交货方式</td>
        <td>物流单号</td>
        <td>附件成本</td>
        <td>交货地点</td>
    </tr>
    <c:forEach items="${pageInfo.list}" var="li">
        <tr>
            <td>${li.id}</td>
            <td>${li.xiadanshijian}</td>
            <td>${li.dingdanbianhao}</td>
            <td>${li.zhidanren}</td>
            <td>${li.cangku}</td>
            <td>${li.kuwei}</td>
            <td>${li.dinghuoren}</td>
            <td>${li.zongjine}</td>
            <td>${li.zherangjine}</td>
            <td>${li.jiaohuofangshi}</td>
            <td>${li.wuliudanhao}</td>
            <td>${li.fujianchengben}</td>
            <td>${li.jiaohuodidian}</td>
        </tr>
    </c:forEach>
    <tr>
        <td colspan="20">
            <input type="button" value="首页" onclick="fenye(1)">
            <input type="button" value="上一页" onclick="fenye(${pageInfo.isIsFirstPage()?1:pageInfo.prePage})">
            <input type="button" value="下一页" onclick="fenye(${pageInfo.isIsLastPage()?pageInfo.pages:pageInfo.nextPage})">
            <input type="button" value="尾页" onclick="fenye(${pageInfo.pages})">
            <input type="button" value="添加" onclick="toadd()">
        </td>
    </tr>
</table>
</body>
<script>
    function fenye(cpage) {
        $("[name='cpage']").val(cpage)
        $("form").submit()
    }
    function toadd() {
        location="toadd.do"
    }
</script>
</html>
